package com.qfedu.sys.config;

import com.qfedu.sys.utils.RedisCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;

/**
 * @Author WangHuaiyu
 * Created by 529044029@qq.com
 * Date on 2023/7/9  10:07
 * @Version 1.0
 * @Param $
 * @return $
 */
@Component
@ComponentScan(basePackages = "com.qfedu.sys.config")
public class InitPostConstruct {
    @Autowired private RedisTemplate redisTemplate;
    @Autowired private UserDetailsService userDetailsService;
    @Autowired private RedisCache redisCache;

    public static RedisTemplate redisTemplateStatic;
    public static UserDetailsService userDetailsServiceStatic;
    public static RedisCache redisCacheStatic;

    @PostConstruct
    public void initRedisTemplate() {
        redisTemplateStatic = this.redisTemplate;
        userDetailsServiceStatic = this.userDetailsService;
        redisCacheStatic = this.redisCache;
    }
}
